//==========================================================================//
//                                                                          //
//  ZXTHERM Demo Sketch         Version 0.1                     March 2012  //
//                                                                          //
//  Written for the Arduino Duemilanove w/ ATmega328                        //
//                                                                          //
//  ZXTHERM Arduino Library Demo Sketch                                     // 
//                                                                          //
//  Created by JFLagarde (jeanfrancoislagarde@hotmail.com)                  //
//                                                                          //
//  This file is part of OpenWS (http://code.google.com/p/openws/)          //
//                                                                          //
//==========================================================================//
//                                                                          //
//  Notes:                                                                  //
//                                                                          //
//                                                                          //
//==========================================================================//
//                                                                          //
//  Copyright 2012 Jean-Francois Lagarde (jeanfrancoislagarde@hotmail.com)  //
//  This program is distributed under the terms of                          //
//  the GNU General Public License                                          //
//                                                                          //
//  This program is free software: you can redistribute it and/or modify    //
//  it under the terms of the GNU General Public License as published by    //
//  the Free Software Foundation, either version 3 of the License, or       //
//  (at your option) any later version.                                     //
//                                                                          //
//  This program is distributed in the hope that it will be useful,         //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           //
//  GNU General Public License for more details.                            //
//                                                                          //
//  You should have received a copy of the GNU General Public License       //
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.   //
//                                                                          //
//==========================================================================//

#include <ZXTHERM.h>

// Setup a ZXTHERM instance
ZXTHERM myZXTHERM = ZXTHERM();

void setup(void) { 
	// start serial port
	Serial.begin(9600);
	Serial.println("ZXTHERM Library Demo");

	delay(1000);
	analogReference(EXTERNAL);
	myZXTHERM.init(0);
}

void loop(void) { 
	delay(2000);
	Serial.print("Requesting data...");
	myZXTHERM.read();

	Serial.print("Got Data ");
	Serial.print(myZXTHERM.getTemperature()/10);
	Serial.print(".");
	Serial.print(myZXTHERM.getTemperature()%10);
	Serial.print(" C");
	Serial.println();
}
